package com.wjw.dependenceinversion.inversion02;

import com.wjw.dependenceinversion.inversion02.service.Equipment;
import com.wjw.dependenceinversion.inversion02.service.impl.Light;
import com.wjw.dependenceinversion.inversion02.service.impl.Sound;

/**
 * TODO: 描述
 *
 * @author ikaros
 * @date 2024/7/8 0:38
 * @see <a href="ikaros@qq.com">mailTo: ikaros@qq.com</a>
 */
public class Switch {
    public static void main(String[] args) {
        Switch swi = new Switch();
        swi.execute(new Light());
        swi.execute(new Sound());
    }

    public void execute(Equipment equipment) {
        equipment.turnOn();
        System.out.println("开了");
        equipment.turnOff();
        System.out.println("关了");
    }
}
